package com.itboye.sunsun.activity;

import android.content.Context;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import com.itboye.pondteam.bean.DeviceDetailModel;
import com.itboye.pondteam.utils.NextTime;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import sunsun.xiaoli.jiarebang.device.petfeeder.VoiceEntryActivity;

import static com.itboye.pondteam.utils.MyTimeUtil.getTimeZone;
import static org.junit.Assert.assertEquals;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class XiaoLiTest {


    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();
        assertEquals("com.itboye.pondteam", appContext.getPackageName());
    }

    @Rule
    public ActivityTestRule<VoiceEntryActivity> mActivityTestRule =
            new ActivityTestRule<VoiceEntryActivity>(VoiceEntryActivity.class);


    @Test
    public void testProgress() {
        final Context appContext = InstrumentationRegistry.getTargetContext();
//        new Handler().post(new Runnable() {
//            @Override
//            public void run() {
//                MAlert.alert(appContext.getPackageName());
//            }
//        });
//        mActivityTestRule.getActivity().startThread();

        mActivityTestRule.launchActivity(new Intent("sunsun.xiaoli.jiarebang.device.petfeeder.VoiceEntryActivity").putExtra("model",new DeviceDetailModel()));
//        mActivityTestRule.launchActivity(new Intent("sunsun.xiaoli.jiarebang.device.electromagnetic_air_pump.ElectromagneticAirPumpScanQRCode"));
    }

    @Test
    public void getTime() {
        getTimeZone();
    }

    @Test
    public void testWeek() {
        NextTime.nextTime(4, "", "");
    }

    @Test
    public void getFirst() {
//        mActivityTestRule.getActivity().getTxt_title();
    }

    @Test
    public void testVersion() {

    }



}
